package com.xw.bo.ks.entity.enums;

import com.xw.bo.ks.entity.exception.IException;
import lombok.Getter;

/**
 * 一些异常的集中处理
 *
 * @author： xw
 * @create： 2023/11/4 10:00
 */
@Getter
public enum ExceptionEnum implements IException {


    AES_DECRYPT_EXCEPTION(700, "AES解密异常"),
    AES_ENCRYPT_EXCEPTION(703, "AES加密异常"),
    DS_AUTH_DECRYPT_ERROR(702, "授权code解密失败"),
    NO_AUTH_REFRESH_TOKEN_ERROR(701, "没有刷新token的权限"),
    UPDATE_FAIL(2001, "更新失败"),
    NO_AUTH_ERROR(2002, "无访问权限"),
    AUTH_EXCEPTION(2003, "异常操作权限"),
    PARTNER_AUTH_EXCEPTION(2004, "团长异常操作权限"),
    CHANNEL_AUTH_EXCEPTION(2005, "渠道异常操作权限"),
    MAIN_AUTH_EXCEPTION(2006, "后台异常操作权限"),
    AUTH_TYPE_EXCEPTION(2007, "账号类型权限错误"),
    AUTH_TYPE_EMPTY(2008, "账号类型为空"),

    /**
     * 业务自动为空
     */
    ID_EMPTY(1100, "id不能为空"),
    CODE_EMPTY(1101, "失败：code为空"),
    REFRESH_TOKEN_EMPTY(1002, "没有refreshToken"),
    ACCESS_TOKEN_REDIS_EMPTY(1003, "access token取用失效"),
    COOKIE_EMPTY(1104, "cookie为空"),
    PARAMETER_EMPTY(1105, "参数为空"),
    KS_CHANNEL_GOODS_SAMPLE_ID_EMPTY(1106, "ksChannelGoodsSampleId不能为空"),

    /**
     * 快手请求的一些
     */
    KS_REQUEST_FAIL(1501, "快手网络请求失败"),
    KS_REQUEST_EXCEPTION(1502, "快手请求信息结果错误"),
    KS_ACCESS_TOKEN_FAIL(1504, "获取快手的token失败"),
    KS_REQUEST_USER_FAIL(1506, "快手用户信息请求失败"),
    KS_REQUEST_API_FAIL(1507, "请求快手接口异常，请确认请求信息是否正确"),
    KS_REQUEST_OPEN_ID_ERROR(1508, "快手网络请求错误，openId未返回"),

    /**
     * 公司或者company_id等相关信息异常
     */
    COMPANY_ID_PLEASE_EMPTY(1511, "公司id为空，请输入公司id"),
    COMPANY_ID_CHANGE_EXCEPTION(1512, "公司id转换异常"),
    ID_CHANGE_EXCEPTION(1512, "请求头id为空"),
    COMPANY_ID_EMPTY(1513, "公司id为空"),
    CHANNEL_ID_EMPTY(1514, "渠道id为空"),
    ANCHOR_SAMPLE_ID_EMPTY(1515, "达人领样id为空"),
    COMPANY_NOT_FOUND(1521, "公司未授权"),
    AUTH_FAIL(1522, "授权失败"),
    COMPANY_AUTH_FAILED(1523, "公司已经授权，此次授权失败"),
    COMPANY_ID_ERROR(1524, "公司id错误"),

    ITEM_ID_EMPTY(3001, "商品id为空"),
    ACTIVITY_ID_EMPTY(3002, "活动id为空"),
    PARTNER_ID_EMPTY(3003, "团长id为空"),
    STORE_NAME_EMPTY(3004, "店铺名称不能为空"),
    CHANNEL_NAME_EMPTY(3005, "渠道名称不能为空"),
    ITEM_INFO_ERROR(3006, "商品不存在"),
    CHANNEL_ERROR(3007, "渠道错误"),
    COLLECT_GOODS_EMPTY(3008, "收藏id和商品id不能为空"),
    ANCHOR_ID_EMPTY(3009, "达人id不能为空"),
    ANCHOR_CREATE_ERROR(3010, "达人操作失败"),
    ACTIVITY_ID_PARSE_ERROR(3011, "活动id解析异常"),
    ITEM_ACTIVITY_ID_EMPTY(3012, "商品或者活动id不能为空"),
    CHANNEL_EMPTY(3013, "渠道不存在"),
    PARTNER_EMPTY(3014, "团长不存在"),
    PARTNER_EMPTY_CONTACT(3015, "该商品未绑定招商，请联系招商认领商品后，再操作"),

    PAGE_ERROR(4001, "分页超出范围"),

    CHANNEL_COLLECT_GOODS_INFO_EMPTY(5001, "渠道收藏商品信息为空"),
    PARTNER_AUDIT_SAMPLE_STATUS_EMPTY(5002, "领样状态为空"),
    PARTNER_AUDIT_SAMPLE_STATUS_ERROR(5003, "领样状态错误"),
    PARTNER_SAMPLE_ERROR(5005, "领样订单错误"),
    PARTNER_SAMPLE_ANCHOR_ERROR(5008, "达人领样订单错误"),
    PARTNER_REJECT_REASON_EMPTY(5004, "请填写拒绝原因"),
    PARTNER_NO_AUDIT_SAMPLE_ERROR(5006, "订单不能重复审核"),
    EXPRESS_SAMPLE_ERROR(5007, "快递信息错误"),
    PARTNER_SAMPLE_ID_EMPTY(5009, "领样ID为空"),
    PARTNER_SAMPLE_BATCH_ERROR(5010, "寄样订单批量操作错误"),
    ORDER_INFO_ERROR(5011, "订单信息错误"),
    ORDER_INFO_STATUS_EMPTY(5012, "订单状态为空"),
    REJECT_REASON_EMPTY(5005, "请填写理由"),
    ORDER_MESSAGE_EMPTY(5013, "留言不能为空"),

    LOGIN_NAME_EMPTY(6001, "用户名不能为空"),
    LOGIN_PASSWORD_EMPTY(6002, "用户名不能为空"),
    LOGIN_TOKEN_ERROR(6003, "生成token异常"),
    LOGIN_NAME_PASSWORD_ERROR(6004, "账号密码错误"),

    DATE_FORMAT_EXCEPTION(2003,"时间格式转换异常"),
    DATE_EMPTY(2004,"时间不能为空"),
    START_GE_END_DATE(2005,"开始时间不能大于结束时间"),
    TIME_FRAME_31(2006,"时间跨度不能超过31天"),
    NUMBER_CHANGE_EXCEPTION(2002,"数字转换异常");


    private final Integer errCode;

    private String errMessage;


    ExceptionEnum(Integer errCode, String errMessage) {
        this.errCode = errCode;
        this.errMessage = errMessage;
    }

    public void setErrMessage(String message){
        errMessage = message;
    }

}
